Skip to content

chore: sync more tests and support ignoring#614

Merged
stephenamar-db merged 1 commit intodatabricks:masterfrom
He-Pin:syncTests
Mar 1, 2026
Merged

chore: sync more tests and support ignoring#614
stephenamar-db merged 1 commit intodatabricks:masterfrom
He-Pin:syncTests

Conversation

@He-Pin
Copy link
Contributor

@He-Pin He-Pin commented Feb 28, 2026

Motivation:
Some tests are not suitable for sjsonnet, eg, error.std_parseYaml1.jsonnet
in google/jsonnet#1292

Copilot AI review requested due to automatic review settings February 28, 2026 00:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the upstream test-suite sync workflow so sjsonnet can selectively skip known-incompatible upstream tests, while also adding coverage for parser recursion depth handling.

Changes:

  • Add per-suite .sync_ignore support to sync_test_suites.sh so specific upstream tests (and their goldens) can be excluded during syncing.
  • Add a new parse-depth regression test (error.parse.deep_array_nesting.jsonnet + golden) to ensure recursion-depth errors are handled deterministically.
  • Fix CachedResolver.parse to correctly return Left(ParseError) even when the ParseError has no offset (e.g., recursion-depth errors).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
sync_test_suites.sh Adds .sync_ignore loading and skip logic during sync.
sjsonnet/src/sjsonnet/Importer.scala Ensures offset-less ParseErrors are returned as Left rather than escaping the parser wrapper.
sjsonnet/test/resources/test_suite/error.parse.deep_array_nesting.jsonnet Adds a deep-nesting input intended to trigger the parser recursion-depth guard.
sjsonnet/test/resources/test_suite/error.parse.deep_array_nesting.jsonnet.golden Adds expected output for the recursion-depth parse failure.
sjsonnet/test/resources/test_suite/.sync_ignore Introduces an ignore list for the C++ test suite (initially excluding error.std_parseYaml1.jsonnet).
sjsonnet/test/resources/go_test_suite/.sync_ignore Introduces an (initially empty) ignore list for the Go test suite.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

val docs = docSplitPattern.split(s, -1)
docs.size match {
// Split YAML multi-document stream manually, similar to SnakeYAML's loadAll
// since parseManyYamls doesn't handle all cases correctly
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#
# error.std_parseYaml1.jsonnet: sjsonnet uses SnakeYAML/scala-yaml which
# successfully parses 'a: b:' as {"a":"b:"}, unlike RapidYAML which errors.
error.std_parseYaml1.jsonnet
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephenamar-db stephenamar-db merged commit e29b862 into databricks:master Mar 1, 2026
21 of 24 checks passed
@He-Pin He-Pin deleted the syncTests branch March 1, 2026 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants